/*
* @Author: JINPENG
* @Date:   2018-08-01 20:46:17
* @Last Modified by:   JINPENG
* @Last Modified time: 2018-08-05 16:46:38
*/
'use strict';

var _mm = require('util/mm.js');

var _address = {
     // 获取地址列表
    getAddressList : function(resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/shipping/list.do'),
            data    : {
                pageSize : 50
            },
            success : resolve,
            error   : reject
        });
    },
    //新建收件人地址
    save :  function(addressInfo,resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/shipping/add.do'),
            data    : addressInfo,
            success : resolve,
            error   : reject
        });
    },
    //新建收件人地址
    update :  function(addressInfo,resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/shipping/update.do'),
            data    : addressInfo,
            success : resolve,
            error   : reject
        });
    },
     //删除收件人地址
    deleteAddress :  function(shippingId,resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/shipping/del.do'),
           data    : {
                shippingId : shippingId
            },
            success : resolve,
            error   : reject
        });
    },
     //回去单条数据信息
    getAddress :  function(shippingId,resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/shipping/select.do'),
            data    : {
                shippingId : shippingId
            },
            success : resolve,
            error   : reject
        });
    },
}
module.exports = _address;